\section{Practical Implementation}
\paragraph{}Along with presenting a theoretical solution for anonymous,
peer-grading based on weighted reputations, we have developed a Web 
application which applies a rough version of our model.  We made this 
decision for three reasons.  First, we wished to demonstrate the 
practicability of our theoretical solution, which we intend to be useful 
in the real world.  Second, we wanted to give any interested parties a 
tool with which to begin testing and refining our model without the need 
for them to develop their own applications, which could be a serious 
obstacle.  Finally, we wanted to provide both a code base and a model so 
that others may develop more complete, complex, and robust 
implementations, allowing for easier adoption of our model.
\paragraph{}Our implementation of CLAPTRAP is built on Django, a 
framework for Web-based applications in the Python programming language.  
We chose this framework because of it's high availability and ease of 
use.  Both Django and Python are Free/Libr\`{e} and Open Source 
Software, licensed under the BSD and Python licenses 
respectively.\cite{django, python}  Both are available free of 
charge---a non-trivial concern in the education sector.  Moreover, both 
Django and Python strive for simplicity and readability, which will help 
our project in its goal of serving as a model for other implementations.  
Django is able to use several databases with no changes to the code.  We 
used SQLite3, support for which is included in Python, for individual 
development and testing, and MySQL for production.  SQLite has been 
released into the public domain by its authors\cite{sqlite}, and MySQL 
is licensed under the GPL version 2\cite{mysql}; both are available free 
of charge.  Also taken into consideration was the fact that the Google 
App Engine service is able to run Django applications\cite{kohler}, 
which means that our implementation of CLAPTRAP can be installed and 
used entirely free of charge, accommodating up to a certain number of 
users\cite{google}.
\paragraph{}The presented application defines three sets of users: 
Professors, TAs, and Students.  Professors are administrators for the 
site; they alone can access the administrative interface and create new 
assignments.  In addition, Professor users can access the main part of 
the site and grade papers.  Professors also can view all grades for all 
students and download them as a spreadsheet in the 
comma-separated-values format. TAs are halfway between Professors and 
Students.  They grade assignments but do not have to complete assignments
or give themselves grades.  Students can submit and grade assignments, and see the 
grades given to them.  Each user has a reputation rating, 
which is governed by the algorithm explained in section 3.  It is understood 
that this is not the optimal organization for every educational 
situation; however, it is a generalized form that should be usable by 
many potential users of the implementation.  While the TA group exists, 
for example, the system will continue to work without any TA users 
added.
\paragraph{}Our implementation of CLAPTRAP uses several database tables relating to assigments,
users, and grades. (See Figure 1). The Assignment table maintains assignment names and descriptions
created by a user in the Professor group.  To turn in an assignment, 
member of the Student group creates a Submission, which is associated 
with only one Assignment.  The Submission table maintains references to a file uploaded by the student, as well as 
the student's self-given grade for that assignment.  The Submission table also holds the final grade 
for the student when it is assigned. The Grade table maintains various number grades (which must be on a scale from 0
to 100 in this implementation), each of which 
corresponds to one student's submitted assignment (in the Submissions table). 
The Grade table also contains comments made by graders.  

\begin{figure}[htp]
\centering
\includegraphics[width=\textwidth]{ERDiagram}
\caption{Basic Entity-Relationship Diagram for CLAPTRAP system.  
Attributes are excluded.}
\end{figure}

\paragraph{}The workflow for our implementation begins when a Professor 
user signs in to the administrator interface and creates a new 
Assignment.  When an Assignment is created, a Submission associated with 
that assignment is created for every Student user.  When Student users 
log on and checks the assignments page, they will see every assignment 
for which they have not submitted a file, and a link to the form where 
they can upload the file.  When all students turn in a submission for a particular Assignment,
the Submissions are distributed (using the distribution algorithm described below)
to Professors, TAs, and/or Students for grading.  Ungraded assigned that 
have been distributed to users are visible on an ``Assignments to 
Grade'' page, which gives a link to another page where the user can 
download the submitted file, give comments and assign a grade.  When 
each individual Grade is submitted, the application checks to see if it 
is the last one associated with the Submission.  If so, it calculates 
the Submission's final grade and adjusts the reputation rating for each 
of the graders as defined in the above algorithm.  The final grade, 
along with comments and individual grades, will then be stored in the 
Submissions table and will be visible to the appropriate student and 
professor users.

\paragraph{}  The algorithm for distributing ungraded assignments is the following:
\begin{enumerate}

\item Assignments are first randomly distributed to users with a high 
reputation.  This will include the professor each time
as well as students and TA's with a reputation that is 6 or greater (out of 10).  This ensures that each paper is graded by at least
one trustworthy user.
\item The papers are then randomly assigned to a pool of all students.
\item Step 2 is repeated and the papers are randomly assigned again, so 
that each paper has 3 graders.
\end{enumerate}

\paragraph{}NB:  The algorithm checks to make sure that students are not 
assigned their own assignment to grade and that assignments are not 
distributed more than one time to any one grader.

\paragraph{} Obviously, some level of security is required for the 
anonymity and integrity of the system to remain intact.  Most pages 
require user authentication, and those that display user-specific 
content are generated dynamically from the logged-in user, so that no 
student can see another's grades, submit assignments in another's name, 
or grade in another's name.  Moreover, attempts to access grades, 
submissions, and assignments outside of the intended workflow will 
simply result in an HTTP 404 response.  Submitted files are 
theoretically accessible without user authentication, however the names 
of uploaded files are mangled before storage and the server, if properly 
configured, prevents listing the contents of the submissions directory.  
Moreover, submissions should be submitted without names attached anyway, 
so that even if an uploaded file is accessed improperly, it is not 
identifiable to the student who submitted it.
